function logType(target: object, key: string) {
  const t: object = Reflect.getMetadata("design:type", target, key);
  console.log(`${key} type: ${t}`);
}


interface User {
  name: string
}

function sayHi(name: string): string {
  return name
}

export function rType(obj: ESObject) {
  sayHi('Giovanni') // Hi, Giovanni!
  type T = ReturnType<typeof sayHi> // string

  console.log("0000")
}

const GetReturn = () : MethodDecorator => {

  return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {

    const _return = Reflect.getMetadata('design:returntype', target, propertyKey)

    console.log("return type:", _return)
  }
}
export function ReturnType(type: any): MethodDecorator {
  return (target, propertyKey) => {
    //Reflect.defineMetaData('YOUR_CUSTOM_KEY', type, target, propertyKey);
  }
}

export class ReflectClass {
  @logType
  private a = 'a';

  get getA() {
    return () => {
      return this.a;
    };
  }

  set setA(a: string) {
    this.a = a;
  }

  @GetReturn()
  test(): string {
    return ""
  }
}

